import Network from "./Network";



/**登录注册*/
export const login = (data) => Network.post('/login',data)
export const register = (data) => Network.post('/register',data)
/**零售商*/
export const selectAllNums = (data) =>Network.post('/allNums',data)
export const selectAllData = (data) => Network.post("/retailerByPage",data)
export const editRetailer = (data) => Network.post('/editRetailer',data)
export const deleteRetailer = (id) => Network.delete(`/deleteRetailer/${id}`)
export const addRetailer = (data) => Network.post('/addRetailer',data)
/**货物*/
export const selectAllModities = (data) => Network.get(`/getAllCommdities`,data)
export const selectComNums = (data) =>Network.get('/allComNums',data)
export const addFruits = (data) =>Network.post('/addFruits',data)
export const editFruits = (data) =>Network.post('/editFruits',data)
export const deleteFruits = (id) => Network.delete(`/deleteFruits/${id}`)
/**附属品*/
export const getAllAccessory = (id) => Network.get(`/getAllAccessory/${id}`)
export const addAccessory = (data) => Network.post(`/addAccessory`,data)
export const deleteAccessory = (ids) => Network.post(`/deleteAccessory${ids}`)

/**购销合同*/
export  const getAllContract = (data) => Network.get('/allContract',data)
export  const getAllContractCount = (data) => Network.get('/allContractNums',data)
export  const getAllRetailer = (name) => Network.get(`/contract/getAllRetailer?name=${name}`)
export  const getAllCommdits = (name) => Network.get(`/contract/getAllCommodities?name=${name}`)
export  const createContract = (data) => Network.post(`/contract/add`,data)
export  const getContractDetail = (contractId) => Network.get(`/contract/getContractDetail`,contractId)
export  const deleteContract = (contractId) => Network.post(`/contract/delete/${contractId}`)
